package com.ui.basic.ibatis.dao.admin;

import java.sql.SQLException;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.ibatis.sqlmap.client.SqlMapClient;
import com.ui.basic.ibatis.model.admin.TblAExchangeRate;
import com.ui.basic.ibatis.model.admin.TblAExchangeRateExample;

@Repository("tblAExchangeRateDAO")
public class TblAExchangeRateDAOImpl implements TblAExchangeRateDAO {
    /**
     * This field was generated by Apache iBATIS ibator.
     * This field corresponds to the database table tbl_a_exchange_rate
     *
     * @ibatorgenerated Sun Jun 07 00:19:20 ICT 2009
     */
    @Autowired private SqlMapClient sqlMapClient;

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table tbl_a_exchange_rate
     *
     * @ibatorgenerated Sun Jun 07 00:19:20 ICT 2009
     */
    public TblAExchangeRateDAOImpl() {
        super();
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table tbl_a_exchange_rate
     *
     * @ibatorgenerated Sun Jun 07 00:19:20 ICT 2009
     */
    public void setSqlMapClient(SqlMapClient sqlMapClient) {
        this.sqlMapClient = sqlMapClient;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table tbl_a_exchange_rate
     *
     * @ibatorgenerated Sun Jun 07 00:19:20 ICT 2009
     */
    public SqlMapClient getSqlMapClient() {
        return sqlMapClient;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table tbl_a_exchange_rate
     *
     * @ibatorgenerated Sun Jun 07 00:19:20 ICT 2009
     */
    public int countByExample(TblAExchangeRateExample example) throws SQLException {
        Integer count = (Integer)  sqlMapClient.queryForObject("tbl_a_exchange_rate.ibatorgenerated_countByExample", example);
        return count;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table tbl_a_exchange_rate
     *
     * @ibatorgenerated Sun Jun 07 00:19:20 ICT 2009
     */
    public int deleteByExample(TblAExchangeRateExample example) throws SQLException {
        int rows = sqlMapClient.delete("tbl_a_exchange_rate.ibatorgenerated_deleteByExample", example);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table tbl_a_exchange_rate
     *
     * @ibatorgenerated Sun Jun 07 00:19:20 ICT 2009
     */
    public int deleteByPrimaryKey(Long id) throws SQLException {
        TblAExchangeRate key = new TblAExchangeRate();
        key.setId(id);
        int rows = sqlMapClient.delete("tbl_a_exchange_rate.ibatorgenerated_deleteByPrimaryKey", key);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table tbl_a_exchange_rate
     *
     * @ibatorgenerated Sun Jun 07 00:19:20 ICT 2009
     */
    public void insert(TblAExchangeRate record) throws SQLException {
        sqlMapClient.insert("tbl_a_exchange_rate.ibatorgenerated_insert", record);
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table tbl_a_exchange_rate
     *
     * @ibatorgenerated Sun Jun 07 00:19:20 ICT 2009
     */
    public void insertSelective(TblAExchangeRate record) throws SQLException {
        sqlMapClient.insert("tbl_a_exchange_rate.ibatorgenerated_insertSelective", record);
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table tbl_a_exchange_rate
     *
     * @ibatorgenerated Sun Jun 07 00:19:20 ICT 2009
     */
    @SuppressWarnings("unchecked")
    public List<TblAExchangeRate> selectByExample(TblAExchangeRateExample example) throws SQLException {
        List<TblAExchangeRate> list = sqlMapClient.queryForList("tbl_a_exchange_rate.ibatorgenerated_selectByExample", example);
        return list;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table tbl_a_exchange_rate
     *
     * @ibatorgenerated Sun Jun 07 00:19:20 ICT 2009
     */
    public TblAExchangeRate selectByPrimaryKey(Long id) throws SQLException {
        TblAExchangeRate key = new TblAExchangeRate();
        key.setId(id);
        TblAExchangeRate record = (TblAExchangeRate) sqlMapClient.queryForObject("tbl_a_exchange_rate.ibatorgenerated_selectByPrimaryKey", key);
        return record;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table tbl_a_exchange_rate
     *
     * @ibatorgenerated Sun Jun 07 00:19:20 ICT 2009
     */
    public int updateByExampleSelective(TblAExchangeRate record, TblAExchangeRateExample example) throws SQLException {
        UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
        int rows = sqlMapClient.update("tbl_a_exchange_rate.ibatorgenerated_updateByExampleSelective", parms);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table tbl_a_exchange_rate
     *
     * @ibatorgenerated Sun Jun 07 00:19:20 ICT 2009
     */
    public int updateByExample(TblAExchangeRate record, TblAExchangeRateExample example) throws SQLException {
        UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
        int rows = sqlMapClient.update("tbl_a_exchange_rate.ibatorgenerated_updateByExample", parms);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table tbl_a_exchange_rate
     *
     * @ibatorgenerated Sun Jun 07 00:19:20 ICT 2009
     */
    public int updateByPrimaryKeySelective(TblAExchangeRate record) throws SQLException {
        int rows = sqlMapClient.update("tbl_a_exchange_rate.ibatorgenerated_updateByPrimaryKeySelective", record);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table tbl_a_exchange_rate
     *
     * @ibatorgenerated Sun Jun 07 00:19:20 ICT 2009
     */
    public int updateByPrimaryKey(TblAExchangeRate record) throws SQLException {
        int rows = sqlMapClient.update("tbl_a_exchange_rate.ibatorgenerated_updateByPrimaryKey", record);
        return rows;
    }

    /**
     * This class was generated by Apache iBATIS ibator.
     * This class corresponds to the database table tbl_a_exchange_rate
     *
     * @ibatorgenerated Sun Jun 07 00:19:20 ICT 2009
     */
    private static class UpdateByExampleParms extends TblAExchangeRateExample {
        private Object record;

        public UpdateByExampleParms(Object record, TblAExchangeRateExample example) {
            super(example);
            this.record = record;
        }

        public Object getRecord() {
            return record;
        }
    }
}